package com.southern.gateway.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.southern.gateway.base.ResultModel;
import com.southern.gateway.feign.sysApi.SysApiUser;



@RequestMapping(value = "/testapi")
@RestController
public class TestController {
	
	@Autowired
	SysApiUser sysApiUser;
	
	@RequestMapping(value = "/search", method = RequestMethod.GET)
	public ResultModel search(@RequestParam(value = "username", required = false) String username,
			@RequestParam(value = "nickname", required = false) String nickname,
			@RequestParam(value = "department", required = false) String department,
			@RequestParam(value = "page_num", required = false, defaultValue = "1") int pageNum,
			@RequestParam(value = "page_size", required = false, defaultValue = "10") int pageSize) {

		return ResultModel.success( sysApiUser.getUserList(username,nickname,department,pageNum, pageSize));
	}
}
